package com.ysg.utils;

import android.app.Activity;
import android.view.View;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

import com.gyf.immersionbar.ImmersionBar;

public class YStatusBarUtil {
    /**
     * 指定主题：需要指定titleBar
     */
    public static void setColorTheme(Fragment fragment, View title, int color){
        ImmersionBar.with(fragment)
                .keyboardEnable(true)
                .titleBar(title)
                .statusBarColor(color)
                .init();
    }
    public static void setColorTheme(FragmentActivity fragment, View title, int color){
        ImmersionBar.with(fragment)
                .keyboardEnable(true)
                .titleBar(title)
                .statusBarColor(color)
                .init();
    }


    /**
     * 黑色主题：需要指定titleBar
     */
    public static void setDarkTheme(Fragment fragment, View title){
        ImmersionBar.with(fragment)
                .keyboardEnable(true)
                .statusBarDarkFont(true, 0.2f)
                .titleBar(title)
                .init();
    }

    /**
     * 黑色主题：需要指定titleBar
     */
    public static void setDarkTheme(Activity activity, View title){
        ImmersionBar.with(activity)
                .keyboardEnable(true)
                .statusBarDarkFont(true, 0.2f)
                .titleBar(title)
                .init();
    }

    /**
     * 图片主题：需要指定title
     */
    public static void setImageTheme(Fragment fragment, View title){
        ImmersionBar.with(fragment)
                .keyboardEnable(true)
//                .fullScreen(false)
                .titleBar(title)
                .init();
    }

    /**
     * 图片主题：需要指定title
     */
    public static void setImageTheme(FragmentActivity activity, View title){
        ImmersionBar.with(activity)
                .keyboardEnable(true)
                .titleBar(title)
                .init();
    }


}
